<template>
  <el-table-column v-bind="$attrs">
    <template #default="scope">
      <slot name="default" v-bind="scope" v-if="!columnStatusArray[scope.$index]" >
        <span @click="handleClick(scope)" style="cursor: pointer">{{ scope.row[scope.column.property] }}</span>
      </slot>
      <slot name="editor" v-bind="scope" v-else >
        <component :is="ElInput" v-bind="$attrs" v-model="scope.row[scope.column.property]"></component>
      </slot>
    </template>
  </el-table-column>
</template>

<script setup>
import { inject } from 'vue'
import { ElInput } from 'element-plus'

const columnStatusArray = inject('columnStatusArray')

const handleClick = (scope) => {
  console.log(scope);
}
</script>